<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Route::group(['namespace' => 'Api'],function(){
	Route::post('login','AuthController@login');

	Route::post('fileUpload','FileUploadController@store');

	Route::get('permissions','AuthController@permissions')->middleware('login');

	Route::group([
		'middleware' => [
			// 'login',
			// 'permission'
		]
	],function(){
		Route::get('DeviceAlarmMessage/HandlingSituation','DeviceAlarmMessageController@handlingSituation');

		Route::resource('DeviceAlarmMessage','DeviceAlarmMessageController');

		Route::resource('DeviceConfig','DeviceConfigController');

		Route::get('IC/ProcessNode','IcController@processNode');

		Route::get('IC/IcStatus','IcController@icStatus');

		Route::resource('IC','IcController');

		Route::get('IcRecord/HaveSfz','IcRecordController@haveSfz');

		Route::get('IcRecord/SfzinfoType','IcRecordController@sfzinfoType');

		Route::resource('IcRecord','IcRecordController');

		Route::group(['prefix' => 'InternalVehicle'],function(){
			Route::put('updateIsVoid/{id}','InternalVehicleController@updateIsVoid');

			Route::put('updateEmptyType/{id}','InternalVehicleController@updateEmptyType');

			Route::put('updateIsLoading/{id}','InternalVehicleController@updateIsLoading');

			Route::put('updateIsReturn/{id}','InternalVehicleController@updateIsReturn');

			Route::put('updateIsGo/{id}','InternalVehicleController@updateIsGo');

			Route::put('updatePurchaseWeight/{id}','InternalVehicleController@updatePurchaseWeight');

			Route::put('updateDischargeWeight/{id}','InternalVehicleController@updateDischargeWeight');

			Route::put('updatePickWeight/{id}','InternalVehicleController@updatePickWeight');

			Route::put('updateException/{id}','InternalVehicleController@updateException');

			Route::put('success/{id}','InternalVehicleController@success');

			Route::get('access','InternalVehicleController@access');
		});

		Route::resource('InternalVehicle','InternalVehicleController');

		Route::resource('LoginHistory','LoginHistoryController');

		Route::get('SettlementWeight/Weight','SettlementWeightController@isWeight');

		Route::get('SettlementWeight/Export','SettlementWeightController@export');

		Route::group([
			'prefix' => 'SettlementWeight'
		],function(){
			Route::get('/','SettlementWeightController@index');

			Route::post('/','SettlementWeightController@store');

			Route::get('/{id}','SettlementWeightController@show');

			Route::put('/{id}','SettlementWeightController@update');

			Route::delete('/{id}','SettlementWeightController@destroy');
		});

		Route::post('SystemConfig/ShiBang','SystemConfigController@shiBang');

		Route::resource('SystemConfig','SystemConfigController');

		Route::get('WeighAbnormal/Export','WeighAbnormalController@export');

		Route::resource('WeighAbnormal','WeighAbnormalController');

		Route::get('Weightdata/ProcessNumber','WeightdataController@processNumber');

		Route::get('Weightdata/TransType','WeightdataController@transType');

		Route::get('Weightdata/TransStatus','WeightdataController@transStatus');

		Route::get('Weightdata/IsFinished','WeightdataController@isFinished');

		Route::get('Weightdata/WeightStatus','WeightdataController@weightStatus');

		Route::get('Weightdata/Export','WeightdataController@export');

		Route::resource('Weightdata','WeightdataController');

		Route::resource('Account','AccountController');

		Route::get('SnapAbnormal/HandlingSituation','SnapAbnormalController@handlingSituation');

		Route::get('SnapAbnormal/Export','SnapAbnormalController@export');

		Route::resource('SnapAbnormal','SnapAbnormalController');

		Route::resource('printConfig','PrintConfigController');

		Route::resource('SystemAbnormal','SystemAbnormalController');

		Route::get('User/Role','UserController@roleId');

		Route::resource('User','UserController');

		Route::resource('Role','RoleController');

		Route::resource('Permission','PermissionController');

		Route::group(['prefix' => 'flow'],function(){
			Route::get('FlowExtemal','FlowExtemalController@getFlowExtemal');

			Route::get('export','FlowExtemalController@export');

			Route::put('purchase_weight/{id}','FlowExtemalController@updatePurchaseWeight');

			Route::put('discharge_weight/{id}','FlowExtemalController@updateDischargeWeight');

			Route::put('pick_weight/{id}','FlowExtemalController@updatePickWeight');

			Route::put('out_weight/{id}','FlowExtemalController@updateOutWeight');

			Route::get('is_return','FlowExtemalController@isReturn');

			Route::put('is_return/{id}','FlowExtemalController@updateIsReturn');

			Route::get('is_go','FlowExtemalController@isGo');

			Route::put('is_go/{id}','FlowExtemalController@updateIsGo');

			Route::put('remark/{id}','FlowExtemalController@updateRemark');

		});

		Route::get('Summary','SummaryController@index');

		Route::get('Summary/Export','SummaryController@export');

		Route::get('Summary/entry_exit_record','EntryExitRecordController@index');

		Route::get('Summary/entry_exit_record/export','EntryExitRecordController@export');
	});

});

